const path = require('path');

module.exports = {
  mode: 'development',
  entry: './src/index.js',
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'dist')
  },
  module: {
      rules: [{
          test: /\.(js|jsx)$/,
          exclude: /node_modules/,
          use: {
              loader: 'babel-loader',
              options: {
                  presets: ['@babel/preset-env', '@babel/preset-react']
              }
          }
      }, {
          test: /\.css$/,
          use: ['style-loader', 'css-loader']
          }, {
              test: /\.less$/,
              use: ['style-loader', 'css-loader', {
                  loader: 'less-loader',
                  options: {
                      lessOptions: {
                          javascriptEnabled: true
                      }
                  },
              }]
          }]
  },
  devServer: {
      contentBase: path.resolve(__dirname, "www"),
      publicPath: '/dist/',
      port: 9000,
      proxy: {
          "/api": "http://127.0.0.1:8080"

      }
  }
};